#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int n = 0;
	int i = 0;
	int count = 0;
	scanf("%d", &n);
	int* p = (int*)malloc(n * sizeof(int));
	if (p == NULL)
	{
		perror("malloc");
		return 1;
	}
	for (i = 0; i < n; i++)
	{
		scanf("%d", p + i);
	}
	//1 2 2 4 8
	if (*(p + 0) != 1)
	{
		count++;
		*(p + 0) = 1;
	}
	if (*(p + 1) != 1)
	{
		count++;
		*(p + 1) = 1;
	}
	for (i = 2; i < n; i++)
	{
		if (*(p + i) != *(p + i - 1) + *(p + i - 2))
		{
			*(p + i) = *(p + i - 1) + *(p + i - 2);
			count++;
		}
	}
	printf("%d\n", count);
	free(p);
	return 0;
}